#include <iostream>
#include "cppTutorVirtualCallInConstructor.h"

// log framework
#include "cppTutorLog.h"
extern CcppTutorLog Log;

using namespace std;

void m_Print () {
    Log << "ENTER : m_Print" << endl;
    cout << "--------------------------" << endl;
    cout << " virtual call from derived class object will call the base class version of virtual function if called from inside constructor" << endl;
    cout << "--------------------------" << endl;
    Log << "EXIT  : m_Print" << endl;
}

CcppTutorVirtualCallInConstructor :: CcppTutorVirtualCallInConstructor () {
    Log << "ENTER : CcppTutorVirtualCallInConstructor :: CcppTutorVirtualCallInConstructor" << endl;
    m_Print ();
    Log << "EXIT  : CcppTutorVirtualCallInConstructor :: CcppTutorVirtualCallInConstructor" << endl;
}

CcppTutorVirtualCallInConstructor :: ~CcppTutorVirtualCallInConstructor () {
    Log << "ENTER : CcppTutorVirtualCallInConstructor :: ~CcppTutorVirtualCallInConstructor" << endl;
    Log << "EXIT  : CcppTutorVirtualCallInConstructor :: ~CcppTutorVirtualCallInConstructor" << endl;
}

void CcppTutorVirtualCallInConstructor :: check () {
    Log << "ENTER : CcppTutorVirtualCallInConstructor :: check" << endl;
    m_Print ();
    Log << "EXIT  : CcppTutorVirtualCallInConstructor :: check" << endl;
}

CVCICDerived :: CVCICDerived () {
    Log << "ENTER : CVCICDerived :: CVCICDerived" << endl;
    Log << "EXIT  : CVCICDerived :: CVCICDerived" << endl;
}

CVCICDerived :: ~CVCICDerived () {
    Log << "ENTER : CVCICDerived :: ~CVCICDerived" << endl;
    Log << "EXIT  : CVCICDerived :: ~CVCICDerived" << endl;
}

void CVCICDerived :: check () {
    Log << "ENTER : CVCICDerived :: check" << endl;
    Log << "EXIT  : CVCICDerived :: check" << endl;
}
